import request from '@/utils/request'
import request2 from '@/utils/request2'
import {projectApiUrl} from '../config'

/**
 * 设计变更列表
 * @param parameter
 */
export function getDesignChangeList(parameter){
  return request({
    url: projectApiUrl+'/project/design-change/list',
    method: 'post',
    data: parameter
  })
}

/**
 * 设计变更统计
 * @param
 */
export function getDesignTotal(data){
  return request({
    url: projectApiUrl+'/project/design-change/total/total',
    method: 'post',
    data
  })
}
/**
 * 设计变更上传文件批量删除
 * @param
 */
export function deleteDesignChangeFile(data){
  return request({
    url: projectApiUrl+'/project/design-change/fileDelete',
    method: 'post',
    data:data
  })
}

/**
 * 设计变更上传文件批量删提交审核
 * @param
 */
export function designChangeFilCommit(data){
  return request({
    url: projectApiUrl+'/project/design-change/commit-audit',
    method: 'post',
    data:data
  })
}


/**
 * 设计支持上传文件提交
 * @param
 */
export function designSupportSubmit(data){
  return request2({
    url: projectApiUrl+'/design/demand/support',
    method: 'post',
    data:data
  })
}
/**
 * 设计支持上传文件批量删除
 * @param
 */
export function deleteDesignReportFile(data){
  return request({
    url: projectApiUrl+'design/demand/report/fileDelete',
    method: 'post',
    data:data
  })
}

/**
 * 设计变更新增
 * @param
 */
export function addDesignChange(data){
  return request({
    url: projectApiUrl+'/project/design-change',
    method: 'post',
    data:data
  })
}

/**
 * 设计变更修改
 * @param
 */
export function editDesignChange(data){
  return request({
    url: projectApiUrl+'/project/design-change/update',
    method: 'post',
    data:data
  })
}


/**
 * 设计变更详情
 * @param
 */
export function getDesignDetails(id){
  return request({
    url: projectApiUrl+'/project/design-change/detail',
    method: 'get',
    params:id
  })
}


/**
 * 设计变更下拉数据
 * @param
 */
export function getDesignChangeLabels(data){
  return request({
    url: projectApiUrl+'/project/design-change/label',
    method: 'get',
    params: data
  })
}

/**
 * 根据分公司查询项目详情
 * @param
 */
export function getProjectBranchType(data){
  return request({
    url: projectApiUrl+'/project-common/user-branch-project/type',
    method: 'post',
    data: data
  })
}


/**
 * 设计变更原因
 * @param
 */
export function getChangeReasons(data){
  return request({
    url: projectApiUrl+'/project/design-change/reason',
    method: 'get',
    params: data
  })
}

/**
 * 设计变更类型
 * @param
 */
export function getChangeTypes(data){
  return request({
    url: projectApiUrl+'/project/design-change/type',
    method: 'get',
    params: data
  })
}
/**
 * 修改岗位接收信息a1
 * @param parameter
 */
export function drawChangeUpdateSoleA(parameter) {
  return request({
      url: `${projectApiUrl}/project/design-change/updateSole?id=${parameter.id}&soleId=${parameter.soleId}`,
      method: 'get',
  })
}


